from abc import ABC
from math import sqrt
import abc

class Math:
    def __init__(self):
        pass

    @staticmethod
    def add(*args):
        result = 0
        for i in range(len(args)):
            result += args[i]
        return result

    @staticmethod
    def subtraction(*args):
        result = args[0]
        for i in range(len(args)):
            if i != 0:
                result -= args[i]
        return result

    @staticmethod
    def multiplication(*args):
        result = args[0]
        for i in range(len(args)):
            if i != 0:
                result *= args[i]
        return result

    @staticmethod
    def division(*args):
        result = args[0]
        for i in range(len(args)):
            if i != 0:
                assert args[i] != 0, '被除数不能为0'
                result /= args[i]
        return result

    @staticmethod
    def power(*args):
        result = args[0]
        for i in range(len(args)):
            if i != 0:
                result **= args[i]
        return result

    @staticmethod
    def evolution(x):
        return sqrt(x)


class OperatingSystem:
    def __init__(self):
        pass

    @abc.abstractmethod
    def start(self):
        pass

    @abc.abstractmethod
    def shutdown(self):
        pass

    @abc.abstractmethod
    def __str__(self):
        pass


class Windows(OperatingSystem, ABC):
    __name = "windows"
    isActive = False

    def __init__(self, version):
        super(Windows, self).__init__()
        self.version = version
        self.__username = "administrator"

    def start(self):
        print("windows开机")

    @staticmethod
    def play_game():
        print("玩游戏")

    def active_windows(self):
        self.isActive = True

    @classmethod
    def get_name(cls):
        return cls.__name

    def __str__(self):
        return f"operating name:{self.__name} version is: {self.version}, current user: {self.__username}"


if __name__ == "__main__":
    print(Math.add(1, 2, 3))
    print(Math.subtraction(10, 2, 1))
    print(Math.multiplication(1, 2, 3))
    print(Math.division(10, 2, 1))
    print(Math.power(2, 3))
    print(Math.evolution(3))
    windows = Windows("10")
    print(windows)
    print(Windows.get_name())
    Windows.play_game()
